package com.woniuxy.rabbit.schedul;

import com.woniuxy.rabbit.service.FinanceMessageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@Slf4j
@Component
public class MessageScheedul {

    @Autowired
    private FinanceMessageService messageService;
    /**
     * 定时任务发送消息
     */
//    @Scheduled(fixedDelay = 30000) //每30秒扫描一次
    public void sendMessage(){
        log.info("定时任务发送消息开始:{}",System.currentTimeMillis());
        messageService.sendMessage();
        log.info("定时任务发送消息结束:{}",System.currentTimeMillis());
    }
}
